import { Controller } from '@nestjs/common';
import { Crud, CrudController, Override, ParsedRequest, ParsedBody, CrudRequest } from '@nestjsx/crud';
import { ApiTags} from '@nestjs/swagger';
import { OrderGoods } from '../../entities/order_goods.entities';
import { OrderGoodsService } from '../../services/order-goods/order-goods.service';

@Crud({
  model:{
    type:OrderGoods,
  },
  query:{
    exclude:["order_id","goods_id"],
    join:{
      product:{
        exclude:['goods_id','market_price']
      },
      'product.goods':{
        exclude:["category_id","brand_id","keywords","is_on_sale","is_delete","attribute_category","is_new","app_exclusive_price","is_app_exclusive","is_limited","is_hot","create_user_id","update_user_id","create_user_dept_id","promotion_tag","add_time","update_time","counter_price","extra_price","unit_price"]
      }
    }
  }
})
@ApiTags('order-goods')
@Controller('api/order-goods')
export class OrderGoodsController {
  constructor(
    public service:OrderGoodsService
  ){}
}
